package org.harsh.transmission.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.harsh.transmission.mapper.TransRecvmsgMapper;
import org.harsh.transmission.domain.TransRecvmsg;
import org.harsh.transmission.service.ITransRecvmsgService;
import com.ruoyi.common.core.text.Convert;
import org.springframework.transaction.annotation.Transactional;

/**
 * 消息接收Service业务层处理
 * 
 * @author liuhaibo
 * @date 2024-08-25
 */
@Service
public class TransRecvmsgServiceImpl implements ITransRecvmsgService 
{
    @Autowired
    private TransRecvmsgMapper transRecvmsgMapper;

    /**
     * 查询消息接收
     * 
     * @param recvMsgId 消息接收主键
     * @return 消息接收
     */
    @Override
    public TransRecvmsg selectTransRecvmsgByRecvMsgId(Long recvMsgId)
    {
        return transRecvmsgMapper.selectTransRecvmsgByRecvMsgId(recvMsgId);
    }

    /**
     * 查询消息接收列表
     * 
     * @param transRecvmsg 消息接收
     * @return 消息接收
     */
    @Override
    public List<TransRecvmsg> selectTransRecvmsgList(TransRecvmsg transRecvmsg)
    {
        return transRecvmsgMapper.selectTransRecvmsgList(transRecvmsg);
    }

    /**
     * 新增消息接收
     * 
     * @param transRecvmsg 消息接收
     * @return 结果
     */
    @Override
    public int insertTransRecvmsg(TransRecvmsg transRecvmsg)
    {
        return transRecvmsgMapper.insertTransRecvmsg(transRecvmsg);
    }

    /**
     * 修改消息接收
     * 
     * @param transRecvmsg 消息接收
     * @return 结果
     */
    @Override
    @Transactional
    public int updateTransRecvmsg(TransRecvmsg transRecvmsg)
    {
        return transRecvmsgMapper.updateTransRecvmsg(transRecvmsg);
    }

    @Override
    @Transactional
    public int setTransSuccess(Long msgId){
        return transRecvmsgMapper.setTransSuccess(msgId);
    }

    /**
     * 批量删除消息接收
     * 
     * @param recvMsgIds 需要删除的消息接收主键
     * @return 结果
     */
    @Override
    public int deleteTransRecvmsgByRecvMsgIds(String recvMsgIds)
    {
        return transRecvmsgMapper.deleteTransRecvmsgByRecvMsgIds(Convert.toStrArray(recvMsgIds));
    }

    /**
     * 删除消息接收信息
     * 
     * @param recvMsgId 消息接收主键
     * @return 结果
     */
    @Override
    public int deleteTransRecvmsgByRecvMsgId(Long recvMsgId)
    {
        return transRecvmsgMapper.deleteTransRecvmsgByRecvMsgId(recvMsgId);
    }
}
